﻿/**
 * 销售汇总
 */
function getSales(pageNo){
	
	$.ajax({
        type: "POST",
        url: contextPath + "/view/sale/getSales",
        dataType: "html",
        data: {'pageNo': pageNo, 'pageSize': 10},
        beforeSend: function () {
            $("#maincontent").html("");
            $("#beforeLoading").show();
            timeOutHint();
        },
        success: function (res) {
            if ("" != res) {
                $("#beforeLoading").hide();
                $("#maincontent").html(res);
            }
        },
        error: function(){
        	$("#beforeLoading").hide();
        	failHint();
        }
    });
}




/**
 * 仓库操作记录
 */
function getOperatestocks(pageNo, flag){
	$.ajax({
        type: "POST",
        url: contextPath + "/view/stocks/getOperatestocks",
        dataType: "html",
        data: {'flag': flag, 'pageNo': pageNo, 'pageSize': 10},
        beforeSend: function () {
            $("#maincontent").html("");
            $("#beforeLoading").show();
            timeOutHint();
        },
        success: function (res) {
            if ("" != res) {
                $("#beforeLoading").hide();
                $("#maincontent").html(res);
            }
        },
        error: function(){
        	$("#beforeLoading").hide();
        	failHint();
        }
    });
}



/**
 * 销售汇总
 */
function getGrossProfit(pageNo){
	
	$.ajax({
        type: "POST",
        url: contextPath + "/view/sale/getSales",
        dataType: "html",
        data: {'pageNo': pageNo, 'pageSize': 10, 'gross': true},
        beforeSend: function () {
            $("#maincontent").html("");
            $("#beforeLoading").show();
            timeOutHint();
        },
        success: function (res) {
            if ("" != res) {
                $("#beforeLoading").hide();
                $("#maincontent").html(res);
            }
        },
        error: function(){
        	$("#beforeLoading").hide();
        	failHint();
        }
    });
}


/**
 * 零售汇总
 * @param pageNo
 */
function getSalesStocksA(pageNo){
	
	$.ajax({
        type: "POST",
        url: contextPath + "/view/sale/getSaleStocks",
        dataType: "html",
        data: {'pageNo': pageNo, 'pageSize': 10, 'mark': "A"},
        beforeSend: function () {
            $("#maincontent").html("");
            $("#beforeLoading").show();
            timeOutHint();
        },
        success: function (res) {
            if ("" != res) {
                $("#beforeLoading").hide();
                $("#maincontent").html(res);
            }
        },
        error: function(){
        	$("#beforeLoading").hide();
        	failHint();
        }
    });
}


/**
 * 批发汇总
 * @param pageNo
 */
function getSalesStocksB(pageNo){
	$.ajax({
        type: "POST",
        url: contextPath + "/view/sale/getSaleStocks",
        dataType: "html",
        data: {'pageNo': pageNo, 'pageSize': 10, 'mark': "B"},
        beforeSend: function () {
            $("#maincontent").html("");
            $("#beforeLoading").show();
            timeOutHint();
        },
        success: function (res) {
            if ("" != res) {
                $("#beforeLoading").hide();
                $("#maincontent").html(res);
            }
        },
        error: function(){
        	$("#beforeLoading").hide();
        	failHint();
        }
    });
}




